//
//  JuliyeViewController.m
//  Zuisuigirveup
//
//  Created by spdbmacbook0003 on 2025/8/4.
//

#import "JuliyeViewController.h"
#import "JuliyeNav.h"
#import <YYImage/YYImage.h>
#import <MJRefresh/MJRefresh.h>
#import <YYText/YYText.h>
@interface JuliyeViewController ()
@property (nonatomic, strong)UIProgressView *porgress;
@property (nonatomic, strong)UIView *loadingaclview;
@property (nonatomic, assign)BOOL showLoadingBOOL;
@property (nonatomic, strong)UILabel *tipLable;

@end

@implementation JuliyeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [self addsuadbbamNavActiosna];
    
    JLYWeakSelf;
    self.nav.leftBtnBlock = ^{
        [weakSelf backAction];
    };
}
- (void)backAction{
    
}
- (void)showNetREquejsaErrro{
    //    YYImage *image = [YYImage imageNamed:@"animation.webp"];
    //    YYAnimatedImageView *imageView = [[YYAnimatedImageView alloc] initWithImage:image];
    //    [self.view addSubview:imageView];
}
- (void)showLoading{
    if(self.showLoadingBOOL)return;
    [self.view addSubview:self.loadingaclview];
    [self.view addSubview:self.porgress];
    self.showLoadingBOOL = YES;
}
- (void)hiddenLoading{
    if(self.showLoadingBOOL == NO)return;
    [self.loadingaclview removeFromSuperview];
    [self.porgress removeFromSuperview];
    self.showLoadingBOOL = NO;
}

- (void)showTipAnmsda:(NSString *)tip{
    if([NSString JZLIsNilString:tip])return;
    if(self.tipLable.hidden == NO)return;
    NSAttributedString *jlystr = [JLYOtherTools JLYGetAttrsudaWithjsTextt:tip];
    CGSize hsij = [JLYOtherTools JLYGetTiplabelsconawith:jlystr];
    self.tipLable.attributedText = jlystr;
    self.tipLable.frame = CGRectMake((JLYScreenWidth - hsij.width)/2.0, (JLYScreenHeight - hsij.height)/2.0, hsij.width+5, hsij.height+5);
    self.tipLable.hidden = NO;
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        self.tipLable.hidden = YES;
    });
}

- (void)addsuadbbamNavActiosna{
    [self.view addSubview:self.nav];
}
-(void)dealloc{
    [[NSNotificationCenter defaultCenter]removeObserver:self];
}
-(JuliyeNav *)nav{
    if(!_nav){
        _nav = [[JuliyeNav alloc]initWithFrame:CGRectMake(0, 0, JLYScreenWidth, JLYNavHeight)];
    }
    return _nav;
}
-(UIProgressView *)porgress{
    if(!_porgress){
        CGFloat szie = 40;
        _porgress = [[UIProgressView alloc]initWithFrame:CGRectMake((JLYScreenWidth -szie)/2.0 , (JLYScreenHeight -szie)/2.0, szie, szie)];
        _porgress.progressViewStyle = UIProgressViewStyleDefault;
    }
    return _porgress;
}
-(UIView *)loadingaclview{
    if(!_loadingaclview){
        _loadingaclview = [[UIView alloc]initWithFrame:CGRectMake(0, 0, JLYScreenWidth, JLYScreenHeight)];
        _loadingaclview.backgroundColor = JLYRGBA(0, 0, 0, 0.1);
    }
    return _loadingaclview;
}
-(UILabel *)tipLable{
    if(!_tipLable){
        _tipLable = [UILabel new];
        _tipLable.font = [UIFont systemFontOfSize:16];
        _tipLable.backgroundColor = JLYRGBA(0, 0, 0, 0.5);
        _tipLable.textAlignment = NSTextAlignmentCenter;
        _tipLable.textColor = [UIColor whiteColor];
        _tipLable.hidden = YES;
        [self.view addSubview:_tipLable];
    }
    return _tipLable;
}
@end
